PATHMac OS 8 and 9 Developer Documentation > Human Interface Toolbox > Window Manager >

Programming With the Mac OS 8.5 Window Manager


CloneWindow

Increments the number of references to a window.

pascal OSStatus CloneWindow (WindowPtr window);
window
A value of type WindowPtr . Pass a pointer to the window whose reference count is to be incremented.
function result
A result code. See Result Codes.
DISCUSSION

You should call CloneWindow if you are using a window and wish to ensure that it is not disposed while you are using it. With the Mac OS 8.5 Window Manager, all windows are created with a reference count (owner count) of one. The function CloneWindow increments the number of references to a window, and the earlier function DisposeWindow decrements the number of references. When the reference count reaches zero, DisposeWindow disposes of the window.

SPECIAL CONSIDERATIONS

To maintain an accurate reference count, you must follow every call to the CloneWindow function with a matching call to the DisposeWindow function when your application is ready to release its reference to the window.

VERSION NOTES

Available with Mac OS 8.5 and later.


© 1999 Apple Computer, Inc. – (Last Updated 18 March 99)